// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router/index'
import axios from 'axios'
import FastClick from 'fastclick'
import store from './store/store.js'
import pxtorem from './assets/pxtorem.js'
import setTitle from './assets/setTitle'
// import wx from 'weixin-js-sdk'
// import MintUI from 'mint-ui'
// import 'mint-ui/lib/style.css'

Vue.config.productionTip = false
FastClick.attach(document.body)
Vue.prototype.setTitle = setTitle
// Vue.use(MintUI)

Vue.prototype.axios = axios
// axios.defaults.baseURL = 'http://kaku.youledi.cn'//测试接口地址
axios.defaults.baseURL = 'http://kaku.atkaku.com'//正式接口地址
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
// axios.defaults.Origin = '*'
// axios.defaults.withCredentials = true
axios.defaults.crossDomain = true
axios.defaults.timeout = 5000
axios.defaults.transformRequest = [function (data) {
  let ret = ''
  for (let it in data) {
    ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
  }
  ret = ret.substring(0, ret.length - 1)
  return ret
}]

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  axios,
  store,
  // MintUI,
  components: { App },
  template: '<App/>'
})
